Using Knowledge Builder Scripting

Knowledge Builder scripting enable procedural scripts with assignments, calculations, conditional code  etc. to be embedded within the logic of your application. It also enables runtime integration with other applications such as Web Services to be called  (ODBC, OLE, DLLs, etc for Windows deployment). Scripting can utilise any Object or Variable available within your application Attributes (of all types), Arrays, as well as Numeric and String Variables. Using the @Do command, scripts can also call any other Object (other Procedures, Trees, Dialogs, etc.)

Scripting can be used in a variety of ways:

 

Procedure type Knowledge Explorer objects are specifically for use with XpertRule @Commands, JavaScript or VBScript (depending on your deployment). They can be used to instigate a procedural command sequence by placing the procedure in the flow of the logic of your application wherever needed. For instance, when inserted into the path of a decision tree or called from another Procedure. Procedures can also be tied a Macro Button on a Dialog.

A set of pre-defined Events are linked to Knowledge Explorer Objects (but not Variables). For example, each List, Boolean, Numeric, Date, Text type Attribute have their own set of events. There are several Event windows for each object (OnCaptureOnLeave and OnUpdate). The mechanics of editing and using the script are just the same as for Procedures. The difference is that Events are intrinsically linked to their own object and are executed when the object is encountered by the inference process. The actual timing of event firing depends for each event are:

Note that you can also use Events to invoke Procedures. Within an Event you can use the standard @DO <procedure_name> command to call a procedure. This technique is handy when you have several Events that could use some common code, and you don't want to repeat the code within each Event.

 Command Blocks are embedded directly in any branch of a Decision Tree and provide an alternative to inserting a Procedure Object. They are used when the Decision Tree logic requires specific (non-reusable) actions to be carried out at different points in the decision tree logic. 

 Notes

How to edit scripts

Inference and scripting

List of XpertRule scripting commands

List of JavaScript commands

Visual Basic Script

List of VBScript commands